﻿using LPP.Entity.Orders;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace LPP.Service.Payment;

/// <summary>
/// 支付服务接口
/// </summary>
public interface IPaymentService
{
    /// <summary>
    /// 创建通用支付
    /// </summary>
    Task<string> CreatePaymentAsync(Order order);

    /// <summary>
    /// 创建支付宝支付
    /// </summary>
    Task<string> CreateAliPayPaymentAsync(string orderId, decimal amount);

    /// <summary>
    /// 创建微信支付
    /// </summary>
    Task<string> CreateWeChatPayPaymentAsync(string orderId, decimal amount);

    /// <summary>
    /// 验证支付通知签名
    /// </summary>
    bool VerifyNotify(Dictionary<string, string> parameters);

    /// <summary>
    /// 验证支付结果
    /// </summary>
    Task<bool> VerifyPaymentAsync(string orderId, string tradeNo);

    /// <summary>
    /// 验证指定支付方式的支付结果
    /// </summary>
    Task<bool> VerifyPaymentAsync(string orderId, string tradeNo, string paymentType);

    /// <summary>
    /// 处理通用支付通知
    /// </summary>
    Task<bool> HandlePaymentNotifyAsync(Dictionary<string, string> parameters);

    /// <summary>
    /// 处理支付宝支付通知
    /// </summary>
    Task<bool> HandleAliPayNotifyAsync(Dictionary<string, string> parameters);

    /// <summary>
    /// 处理微信支付通知
    /// </summary>
    Task<bool> HandleWeChatPayNotifyAsync(Dictionary<string, string> parameters);
}
